Command Prompt Tweaks - Automate the DIR Command

If you go to the command prompt and type

set dircmd=/w/o/p

then press Enter, every time thereafter that you type

dir

the /w/o/p switches will be automatically applied. Of course, if you want only the /p switch, you can type

set dircmd=/p

and press Enter.

You can undo the /w or /o or /p on each instance by simply typing

dir /-switch whatever

For example, if you wanted to do a directory with only the /w switch, you could enter

dir /-p/-o

This is a nice trick that I've been using for a while now, and I really like it. When you exit the Command prompt window, however, the Dircmd setting returns to its default settings.

 


Author:

Lex van der Horst

Date Added:

12-12-2004

Last Reviewed:

12-12-2004